﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Automobile.service.DAL;
using Automobile.service.Model;
using System.Data;

namespace Automobile.service.BLL
{
    public class StockBLL
    {
        StockDAL dal = new StockDAL();
        /// <summary>
        /// 库存管理——显示
        /// </summary>
        /// <returns></returns>
        public DataTable ShowListDataTable()
        {
            return dal.ShowListDataTable();
        }
        /// <summary>
        /// 库存管理——添加
        /// </summary>
        /// <param name="s"></param>
        /// <returns></returns>
        public int AddStock(Stock s)
        {
            return dal.AddStock(s);
        }
        /// <summary>
        /// 库存管理——删除支持多删
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public int DelStock(string id)
        {
            return dal.DelStock(id);
        }
        /// <summary>
        /// 库存管理——根据编号获取数据
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public DataTable GetStockByid(int id)
        {
            return dal.GetStockByid(id);
        }
        /// <summary>
        /// 库存管理——修改
        /// </summary>
        /// <param name="s"></param>
        /// <returns></returns>
        public int UpdStockById(Stock s)
        {
            return dal.UpdStockById(s);
        }
        /// <summary>
        /// 库存管理——根据商品名称搜索
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public DataTable GetStockByName(string name)
        {
            return dal.GetStockByName(name);
        }
        /// <summary>
        /// 库存管理——显示总条数
        /// </summary>
        /// <returns></returns>
        public int GetStockCount()
        {
            return dal.GetStockCount();
        }
    }
}
